package com.jack.payment.dao.user;

import com.jack.payment.entity.filter.UserFilter;
import com.jack.payment.entity.generate.user.UserApiModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserApiDao {

    /**
     * 筛选有多少条数据
     * @param userApiFilterModel
     * @return
     */
    Integer getAppointUserApiCount(UserFilter.UserApiFilter userApiFilterModel);

    /**
     * 获取指定用户列表
     * @param userApiFilterModel
     * @return
     */
    List<UserApiModel> getAppointUserApiList(UserFilter.UserApiFilter userApiFilterModel);

    /**
     * 查看api是否存在
     * @param apiKey
     * @return
     */
    UserApiModel getAppointApiExist(@Param("id") String id,
                                    @Param("apiKey") String apiKey,
                                    @Param("enable") Integer enable);

    /**
     * 写入一个新的api key, 并与用户进行关联
     * @param userApiModel
     * @return
     */
    boolean insertUserApiKeyInfo(UserApiModel userApiModel);

    /**
     * 修改用户api 信息
     * @param userApiModel
     * @return
     */
    boolean updateUserApiKeyInfo(UserApiModel userApiModel);
}
